<template>
  <tr>
    <td>
      <input
        type="checkbox"
        :checked="obj.checked"
        @input="$emit('select', obj.name)"
      />
    </td>
    <td>{{ obj.name }}</td>
    <td>{{ obj.price }}</td>
    <td>
      <button @click="$emit('change', obj.num - 1)" :disabled="obj.num === 0">
        -
      </button>
      {{ obj.num }}
      <button @click="$emit('change', obj.num + 1)">+</button>
    </td>
    <td>{{ obj.price * obj.num }}</td>
    <td>
      <button @click="$emit('del-event', obj.name)">删除</button>
    </td>
  </tr>
</template>

<script>
export default {
  name: "GouwuChe",
  components: {},
  props: {
    obj: {
      type: Object,
      required: true,
    },
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  methods: {},
};
</script>

<style scoped></style>
